'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {

    /**
   * 推荐
   */
  async recommend() {
    const { ctx } = this;
    const paging =await this.ctx.query
    const {tempo,totalPages} =await this.service.home.recommend(paging)
    ctx.body={
     success: true,
     message: 'ok',
     data:tempo,
     totalPages
    }
  }

    /**
   * 个案
   */
  async plan() {
    const { ctx } = this;
    const paging =await this.ctx.query
    const {tempo,totalPages} =await this.service.home.plan(paging)
    ctx.body={
     success: true,
     message: 'ok',
     data:tempo,
     totalPages
    }
  }
    /**
   * 全案
   */
  async fullService() {
    const { ctx } = this;
    const paging =await this.ctx.query
    const {tempo,totalPages} =await this.service.home.fullService(paging)
    ctx.body={
     success: true,
     message: 'ok',
     data:tempo,
     totalPages
    }
  }
   /**
   * 专题
   */
async project() {
    const { ctx } = this;
    const paging =await this.ctx.query
    const {tempo,totalPages} =await this.service.home.project(paging)
    ctx.body={
     success: true,
     message: 'ok',
     data:tempo,
     totalPages
    }
  }
    /**
   * 调研
   */
  async research() {
    const { ctx } = this;
    const paging =await this.ctx.query
    const {tempo,totalPages} =await this.service.home.research(paging)
    ctx.body={
     success: true,
     message: 'ok',
     data:tempo,
     totalPages
    }
  }
  /**
   * 问答
   */
  async registered() {
    const { ctx } = this;
  } 
    /**
   * 文章
   */
  async article() {
    const { ctx } = this;
    const paging =await this.ctx.query
    const {tempo,totalPages} =await this.service.home.article(paging)
    ctx.body={
     success: true,
     message: 'ok',
     data:tempo,
     totalPages
    }
  } 
}

module.exports = HomeController;
